﻿@{
Layout = null;
}

<!DOCTYPE html>

<html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title>Ajax辅助方法</title>
    <script src="~/Scripts/jquery-3.7.1.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
</head>

<body>
    <div>
        @Ajax.ActionLink("显示客户列表","ShowCustomerList",new AjaxOptions {
            HttpMethod="post",
            LoadingElementId= "loading_div",
            InsertionMode=InsertionMode.Replace,
            UpdateTargetId= "uList"
        })

        @using(Ajax.BeginForm("ShowCustomerList", "Ajax", new AjaxOptions {
            HttpMethod = "post",
            LoadingElementId = "loading_div",
            InsertionMode = InsertionMode.Replace,
            UpdateTargetId = "uList"
        }))
        {
            <input type="submit" value="显示客户列表(表单辅助方法)">
        }
    </div>
    <div id="uList"></div>
    <div id="loading_div"
        style="position: fixed;top: 0px;left: 0px;width: 100vw;height: 100vh;background-color: rgb(0, 0, 0,0.3);display: flex;justify-content: center;align-items: center;display: none;">
        <img src="~/Content/加载中/竖条加载动效loading.gif" />
    </div>
</body>

</html>